//引入store实例对象
import store from '../store'
function hookFn(to, from, next) {
    //检测是否需要拦截
    if (to.meta.notLogin) {
      next()
      return
    }
  
    //检测登陆标志
    let token = store.getters['common/token']
    if (!!token) {
      next()
    } else {
      next('/login')
    }
  
  }

  export default hookFn